home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 1
/
Atari Mega Archive - Volume 1.iso
/
demos
/
mastdemo.zoo
/
batch
/
fib.bat
< prev
next >
Wrap
DOS Batch File
|
1990-03-22
|
307b
|
5 lines
# Fibonacci numbers: try "fib 10" after loading this batch file
alias fib 'unset s ; fib2 \$1 ; rem \$c'
alias fib1 'if "\$1" > "1" {eval \$1 1 - => a ; fib2 \$a ; car s => s ; set s \$c \$s;}'
alias fib2 'if "\$1" <= "1" {set c 1;} else {fib1 \$1 ; car -1o s => a ; car -2o s => b ; eval a b + => c;}'